package cn.shiwei.controller;

import cn.shiwie.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

// 用户接口
@RestController
public class UserController {

    @Autowired
    ServerProperties serverProperties;

    @GetMapping("/getById/{id}")
    public User getById(@PathVariable("id") Long id){
        Integer port = serverProperties.getPort();
        return new User(id, "孙悟空", port + "如来佛祖玉皇大帝观音菩萨指定取西经特派使者花果山水帘洞齐天大圣孙悟空");
    }




}
